]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
MessageTray: clamp unexpanded notification height
authorGiovanni Campagna <gcampagna@src.gnome.org>
Sun, 26 Aug 2012 18:27:06 +0000 (20:27 +0200)
committerGiovanni Campagna <gcampagna@src.gnome.org>
Tue, 28 Aug 2012 23:04:28 +0000 (01:04 +0200)
The height of an unexpanded notification could include expanded
content if the notification has extra widgets (like actions and images),
so tweening to that cause it to expand visually.
Instead, use the height of the message tray before the restyle
as an upper bound.

https://bugzilla.gnome.org/show_bug.cgi?id=682738

data/theme/gnome-shell.css
js/ui/messageTray.js

index ee036a9c83002341a6a07787bd848b33ddd34812..29cd67752949a0dc2139d526422620798e8a663e 100644 (file)
@@ -1210,6 +1210,13 @@ StButton.popup-menu-item:insensitive {
     padding-bottom: 8px;
 }
 
+.notification-unexpanded {
+    /* We want to force the actor at a specific size, irrespective
+       of its minimum and preferred size, so we override both */
+    min-height: 36px;
+    height: 36px;
+}
+
 /* We use row-span = 2 for the image cell, which prevents its height preferences to be
    taken into account during allocation, so its height ends up being limited by the height
    of the content in the other rows. To avoid showing a stretched image, we set the minimum
index b9f190ad45d824860fe221ce129b4ceddaee3279..2a33a1c550a2f5aaf4e77eaa0a2b93fcc75b4d02 100644 (file)
@@ -337,6 +337,7 @@ const Notification = new Lang.Class({
             }));
 
         this.actor = new St.Button({ accessible_role: Atk.Role.NOTIFICATION });
+        this.actor.add_style_class_name('notification-unexpanded');
         this.actor._delegate = this;
         this.actor.connect('clicked', Lang.bind(this, this._onClicked));
         this.actor.connect('destroy', Lang.bind(this, this._onDestroy));
@@ -852,6 +853,8 @@ const Notification = new Lang.Class({
 
     expand: function(animate) {
         this.expanded = true;
+        this.actor.remove_style_class_name('notification-unexpanded');
+
         // The banner is never shown when the title did not fit, so this
         // can be an if-else statement.
         if (!this._titleFitsInBannerMode) {
@@ -889,6 +892,8 @@ const Notification = new Lang.Class({
         // Restore banner opacity in case the notification is shown in the
         // banner mode again on update.
         this._bannerLabel.opacity = 255;
+        // Restore height requisition
+        this.actor.add_style_class_name('notification-unexpanded');
         this.emit('collapsed');
     },